x86 mca: Not GP fault when guest write non 0s or 1s to MCA CTL MSRs.
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 29 Jan 2010 06:48:00 +0000 (06:48 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 29 Jan 2010 06:48:00 +0000 (06:48 +0000)
commitd99fd7abcffdf40da896e2ce3bcc0db4c0796ba7
tree22ff7af9cb5cf6b4f763478c0ae2c54181496f1e
parent66cb09646d9ce8bbe6e2c91d6651e3fd77572cea
x86 mca: Not GP fault when guest write non 0s or 1s to MCA CTL MSRs.

a) For Mci_CTL MSR, Guest can write any value to it. When read back,
it will be ANDed with the physical value. Some bit in physical value
can be 0, either because read-only in hardware (like masked by AMD's
Mci_CTL_MASK), or because Xen didn't enable it.
    If guest write some bit as 0, while that bit is 1 in host, we will
    not inject MCE corresponding that bank to guest, as we can't
    distinguish if the MCE is caused by the guest-cleared bit.

b) For MCG_CTL MSR, guest can write any value to it. When read back,
it will be ANDed with the physical value.
    If guest does not write all 1s. In mca_ctl_conflict(), we simply
    not inject any vMCE to guest if some bit is set in physical MSR
    while is cleared in guest 's vMCG_CTL MSR.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
xen/arch/x86/cpu/mcheck/mce.c
xen/arch/x86/cpu/mcheck/mce.h
xen/arch/x86/cpu/mcheck/mce_intel.c